object FormInspaction: TFormInspaction
  Left = 443
  Top = 228
  Width = 430
  Height = 408
  Caption = #1043#1086#1089'. '#1090#1077#1093'. '#1086#1089#1084#1086#1090#1088
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  Position = poDesktopCenter
  OnHide = FormHide
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object Label2: TLabel
    Left = 8
    Top = 8
    Width = 281
    Height = 19
    Caption = #1055#1088#1086#1093#1086#1078#1076#1077#1085#1080#1077' '#1075#1086#1089'.'#1090#1077#1093'.'#1086#1089#1084#1086#1090#1088#1072
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'DejaVu Sans'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label1: TLabel
    Left = 8
    Top = 40
    Width = 120
    Height = 13
    Caption = #1044#1072#1090#1072' '#1087#1088#1086#1093#1086#1078#1076#1077#1085#1080#1103' '#1043#1058#1054
  end
  object Label3: TLabel
    Left = 152
    Top = 40
    Width = 68
    Height = 13
    Caption = #8470' '#1076#1086#1082#1091#1084#1077#1085#1090#1072
    FocusControl = DBEdit2
  end
  object Label4: TLabel
    Left = 152
    Top = 80
    Width = 70
    Height = 13
    Caption = #1043#1086#1089' '#1085#1086#1084#1077#1088' '#1058#1057
    FocusControl = DBEdit3
  end
  object Label5: TLabel
    Left = 8
    Top = 80
    Width = 50
    Height = 13
    Caption = #1052#1072#1088#1082#1072' '#1058#1057
    FocusControl = DBEdit4
  end
  object Label9: TLabel
    Left = 8
    Top = 120
    Width = 54
    Height = 13
    Caption = #1055#1088#1086#1073#1077#1075' '#1058#1057
    FocusControl = DBEdit8
  end
  object Label10: TLabel
    Left = 8
    Top = 160
    Width = 63
    Height = 13
    Caption = #1055#1088#1080#1084#1077#1095#1072#1085#1080#1077
  end
  object Label6: TLabel
    Left = 152
    Top = 120
    Width = 116
    Height = 13
    Caption = #1044#1072#1090#1072' '#1089#1083#1077#1076#1091#1102#1097#1077#1075#1086' '#1043#1058#1054
  end
  object DBEdit2: TDBEdit
    Left = 152
    Top = 56
    Width = 129
    Height = 21
    DataField = 'NUM_DOC'
    DataSource = DataSourceHead
    TabOrder = 0
  end
  object DBEdit3: TDBEdit
    Left = 152
    Top = 96
    Width = 129
    Height = 21
    DataField = 'NUM_BODY'
    DataSource = DataSourceBus
    ReadOnly = True
    TabOrder = 1
  end
  object DBEdit4: TDBEdit
    Left = 8
    Top = 96
    Width = 137
    Height = 21
    DataField = 'NAME_MODELS'
    DataSource = DataSourceBus
    ReadOnly = True
    TabOrder = 2
  end
  object ButtonSave: TButton
    Left = 24
    Top = 312
    Width = 97
    Height = 25
    Caption = #1057#1086#1093#1088#1072#1085#1080#1090#1100
    TabOrder = 3
    OnClick = ButtonSaveClick
  end
  object Button2: TButton
    Left = 128
    Top = 312
    Width = 105
    Height = 25
    Caption = #1054#1090#1084#1077#1085#1072
    TabOrder = 4
    OnClick = Button2Click
  end
  object DBEdit8: TDBEdit
    Left = 8
    Top = 136
    Width = 137
    Height = 21
    DataField = 'MILEAGE'
    DataSource = DataSourceHead
    TabOrder = 5
  end
  object DBMemo1: TDBMemo
    Left = 8
    Top = 176
    Width = 273
    Height = 121
    DataField = 'REMARK'
    DataSource = DataSourceHead
    ScrollBars = ssVertical
    TabOrder = 6
  end
  object date_next: TDateTimePicker
    Left = 152
    Top = 136
    Width = 97
    Height = 21
    CalAlignment = dtaLeft
    Date = 41556.6677625231
    Time = 41556.6677625231
    DateFormat = dfShort
    DateMode = dmComboBox
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clRed
    Font.Height = -12
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    Kind = dtkDate
    ParseInput = False
    ParentFont = False
    TabOrder = 7
  end
  object date_doc: TDateTimePicker
    Left = 8
    Top = 56
    Width = 89
    Height = 21
    CalAlignment = dtaLeft
    Date = 41556.7140615625
    Time = 41556.7140615625
    DateFormat = dfShort
    DateMode = dmComboBox
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'MS Sans Serif'
    Font.Style = []
    Kind = dtkDate
    ParseInput = False
    ParentFont = False
    TabOrder = 8
    OnChange = date_docChange
  end
  object ds_bus: TpFIBDataSet
    UpdateSQL.Strings = (
      ''
      '    ')
    DeleteSQL.Strings = (
      '')
    InsertSQL.Strings = (
      '')
    RefreshSQL.Strings = (
      '')
    SelectSQL.Strings = (
      'select '
      '    bus.id as id_bus,'
      '    bus.id_models,'
      '    bus.num_body,'
      '    models.name_models,'
      '    bus.vin,'
      '    bus.num_vr,'
      '    bus.date_vr,'
      '    bus.num_ts,'
      '    bus.date_ts,'
      'bus.id_head_state,bus.id_head_service,'
      'case when bus.id_state is null then -1'
      'else bus.id_state end as id_state_null,'
      'bus.id_state'
      'from bus'
      '   inner join models on (bus.id_models = models.id)'
      'where bus.id=:Pid_bus')
    AutoUpdateOptions.UpdateTableName = 'BUS'
    AutoUpdateOptions.KeyFields = 'ID_BUS'
    AutoUpdateOptions.AutoReWriteSqls = True
    AutoUpdateOptions.CanChangeSQLs = True
    Transaction = DataModule_tms.pFIBTransaction_tms
    Database = DataModule_tms.pFIBDatabase_tms
    UpdateTransaction = DataModule_tms.TransactionWrite
    AutoCommit = True
    Left = 296
    Top = 56
    object ds_busID_BUS: TFIBBCDField
      FieldName = 'ID_BUS'
      Size = 0
      RoundByScale = True
    end
    object ds_busID_MODELS: TFIBBCDField
      FieldName = 'ID_MODELS'
      Size = 0
      RoundByScale = True
    end
    object ds_busNUM_BODY: TFIBStringField
      FieldName = 'NUM_BODY'
      EmptyStrToNull = True
    end
    object ds_busNAME_MODELS: TFIBStringField
      FieldName = 'NAME_MODELS'
      Size = 100
      EmptyStrToNull = True
    end
    object ds_busVIN: TFIBStringField
      FieldName = 'VIN'
      EmptyStrToNull = True
    end
    object ds_busNUM_VR: TFIBStringField
      FieldName = 'NUM_VR'
      Size = 50
      EmptyStrToNull = True
    end
    object ds_busDATE_VR: TFIBDateField
      FieldName = 'DATE_VR'
    end
    object ds_busNUM_TS: TFIBStringField
      FieldName = 'NUM_TS'
      Size = 50
      EmptyStrToNull = True
    end
    object ds_busDATE_TS: TFIBDateField
      FieldName = 'DATE_TS'
    end
    object ds_busID_HEAD_STATE: TFIBBCDField
      FieldName = 'ID_HEAD_STATE'
      Size = 0
      RoundByScale = True
    end
    object ds_busID_STATE: TFIBBCDField
      FieldName = 'ID_STATE'
      Size = 0
      RoundByScale = True
    end
    object ds_busID_STATE_NULL: TFIBBCDField
      FieldName = 'ID_STATE_NULL'
      Size = 0
      RoundByScale = True
    end
    object ds_busID_HEAD_SERVICE: TFIBBCDField
      FieldName = 'ID_HEAD_SERVICE'
      Size = 0
      RoundByScale = True
    end
  end
  object DataSourceBus: TDataSource
    DataSet = ds_bus
    Left = 328
    Top = 56
  end
  object ds_head: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    PARENT_ID_HEAD,'
      '    DATE_DOC,'
      '    NUM_DOC,'
      '    DATE_SAVE_DOC,'
      '    ID_STATE,'
      '    ID_BUS,'
      '    ID_ROUTE,'
      '    DATE_START_STATE,'
      '    DATE_END_STATE,'
      '    ID_TYPE_DOC,'
      '    DATE_START_DOC,'
      '    DATE_END_DOC,'
      '    ID_PERSONAL_MEDIC,'
      '    ID_PERSONAL_DRIVER,'
      '    ID_PERSONAL_MECHANIC,mileage,note,remark'
      'FROM'
      '    HEAD '
      'where id=:Pid_head')
    AutoUpdateOptions.UpdateTableName = 'HEAD'
    AutoUpdateOptions.KeyFields = 'ID'
    AutoUpdateOptions.AutoReWriteSqls = True
    AutoUpdateOptions.CanChangeSQLs = True
    AutoUpdateOptions.GeneratorName = 'GEN_HEAD_ID'
    AutoUpdateOptions.WhenGetGenID = wgOnNewRecord
    Transaction = DataModule_tms.pFIBTransaction_tms
    Database = DataModule_tms.pFIBDatabase_tms
    AutoCommit = True
    Left = 296
    Top = 88
    object ds_headID: TFIBBCDField
      FieldName = 'ID'
      Size = 0
      RoundByScale = True
    end
    object ds_headPARENT_ID_HEAD: TFIBBCDField
      FieldName = 'PARENT_ID_HEAD'
      Size = 0
      RoundByScale = True
    end
    object ds_headDATE_DOC: TFIBDateField
      FieldName = 'DATE_DOC'
    end
    object ds_headNUM_DOC: TFIBStringField
      FieldName = 'NUM_DOC'
      EmptyStrToNull = True
    end
    object ds_headDATE_SAVE_DOC: TFIBDateTimeField
      FieldName = 'DATE_SAVE_DOC'
    end
    object ds_headID_STATE: TFIBBCDField
      FieldName = 'ID_STATE'
      Size = 0
      RoundByScale = True
    end
    object ds_headID_BUS: TFIBBCDField
      FieldName = 'ID_BUS'
      Size = 0
      RoundByScale = True
    end
    object ds_headID_ROUTE: TFIBBCDField
      FieldName = 'ID_ROUTE'
      Size = 0
      RoundByScale = True
    end
    object ds_headDATE_START_STATE: TFIBDateTimeField
      FieldName = 'DATE_START_STATE'
    end
    object ds_headDATE_END_STATE: TFIBDateTimeField
      FieldName = 'DATE_END_STATE'
    end
    object ds_headID_TYPE_DOC: TFIBBCDField
      FieldName = 'ID_TYPE_DOC'
      Size = 0
      RoundByScale = True
    end
    object ds_headDATE_START_DOC: TFIBDateTimeField
      FieldName = 'DATE_START_DOC'
    end
    object ds_headDATE_END_DOC: TFIBDateTimeField
      FieldName = 'DATE_END_DOC'
    end
    object ds_headID_PERSONAL_MEDIC: TFIBBCDField
      FieldName = 'ID_PERSONAL_MEDIC'
      Size = 0
      RoundByScale = True
    end
    object ds_headID_PERSONAL_DRIVER: TFIBBCDField
      FieldName = 'ID_PERSONAL_DRIVER'
      Size = 0
      RoundByScale = True
    end
    object ds_headID_PERSONAL_MECHANIC: TFIBBCDField
      FieldName = 'ID_PERSONAL_MECHANIC'
      Size = 0
      RoundByScale = True
    end
    object ds_headMILEAGE: TFIBBCDField
      FieldName = 'MILEAGE'
      Size = 0
      RoundByScale = True
    end
    object ds_headNOTE: TFIBStringField
      FieldName = 'NOTE'
      Size = 500
      EmptyStrToNull = True
    end
    object ds_headREMARK: TFIBMemoField
      FieldName = 'REMARK'
      BlobType = ftMemo
      Size = 8
    end
  end
  object DataSourceHead: TDataSource
    DataSet = ds_head
    Left = 328
    Top = 88
  end
end
